<?php
class Pageley_I18n_Message {
	private $key;
	private $parameters;
	
	public function __construct($key, $parameters = null) {
		$this->key = $key;
		if($parameters != null) {
			if(!($parameters instanceof Pageley_Util_ArrayMap)) {
				$parameters = new Pageley_Util_ArrayMap($parameters);
			}
			$this->parameters = $parameters;
		}
	}
	
	public function getKey() {
		return $this->key;
	}
	
	public function getParameters() {
		return $this->parameters;
	}
	
	public function __toString() {
		return $this->key . ($this->parameters != null ?
			$this->parameters : "");
	}
}